using System;
using Xunit;

namespace Tribe.Cache.Test
{
    
    public class CodeplexIssuesRaisedTests
    {
        private int _counter = 0;
        [Fact]
        public void ItemCallbackShouldOnlyBeRaisedOnce()
        {
            ICache cache = new Cache();
            cache.Get("time", () => GetTime(DateTime.Now), TimeSpan.FromSeconds(910));
            
            Assert.Equal(1, _counter);
        
            
        }
        private DateTime GetTime(DateTime dateTime)
        {
            _counter++;
            return dateTime;
        }
        
    }
}